part of '../repository.dart';

class _WebPaymentMethodDtoFactory {
  const _WebPaymentMethodDtoFactory._internal();

  static const _instance = _WebPaymentMethodDtoFactory._internal();

  factory _WebPaymentMethodDtoFactory() {
    return _instance;
  }

  _WebPaymentMethodDto fromJson(Map<String, dynamic> json) {
    final paymentSystem = json[_kWebPaymentMethodPaymentSystemKey] as String;

    switch (paymentSystem) {
      case _kWebPaymentMethodPaymentSystemValue:
        return _YookassaPaymentMethodDto.fromJson(json);
      default:
        throw UnimplementedError();
    }
  }
}
